home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Internet / WWW / OmniComponents / services / README
Encoding:
Text File  |  1996-03-26  |  1.9 KB  |  60 lines

  1. Customizing the Services Menu Processor
  2. ---------------------------------------
  3.  
  4. The services menu bundle has no built-in knowledge of News or Alexandra.
  5. It is easy to modify it to invoke other external applications. Two things
  6. are necessary for OmniWeb to invoke an external application for a
  7. particular URL:
  8.  
  9.    1. The ServicesMenuProcessor must be registered as being able to
  10.       interpret that kind of URL.
  11.  
  12.    2. There must be a default indicating the Services Menu item to
  13.       invoke.
  14.  
  15. Part 1 is handled by the "converts" list in the Omni.dictionary. The processor
  16. should specify an "input" type of "url/scheme", where scheme is the 
  17. relevant URL scheme, and an "output" type of "omni/source".
  18.  
  19. Part 2 is handled by the "defaultsDictionary". For a given "scheme", the
  20. processor will look for a default named ServiceForScheme. The default
  21. value indicates a Services menu item to invoke.
  22.  
  23. The pasteboard passed to the service contains the URL as an ASCII string.
  24.  
  25. For example, the following Omni.dictionary will cause OmniWeb to invoke
  26. Yftp to process FTP URLs, instead of handling them internally (assuming you
  27. have Yftp installed, etc.):
  28.  
  29. {
  30.     OmniProcessor = {
  31.     OmniServicesMenuProcessor = {
  32.         converts = ({
  33.         input = "url/news";
  34.         output = "omni/source";
  35.         }, {
  36.         input = "url/ftp";
  37.         output = "omni/source";
  38.         cost = 0.5;
  39.         });
  40.     };
  41.     };
  42.  
  43.     OmniPreferenceController = {
  44.     OmniServicesMenuPreferences = {
  45.         defaultsDictionary = {
  46.         ServiceForNews = "Alexandra/Open URL";
  47.         ServiceForFtp = "Yftp/Get";
  48.         };
  49.     };
  50.     };
  51. }
  52.  
  53. Notes:
  54.   - The data returned from the service, if any, is discarded.
  55.   - Even if a default value is specified in the defaults database,
  56.     it must be mentioned in the bundle's defaultsDictionary for OmniWeb's
  57.     defaults machinery to read it.
  58.   - The services specified in the defaultsDictionary can be overridden on
  59.     a per-user basis by NEXTSTEP defaults, e.g.
  60.        dwrite OmniWeb ServiceForNews "SpiffyNews/Open"